<?

/**
 * Interceptor collector. 
 * Some modified POJO class to save info about each Interceptor (in 0.4.x.x Filter) from spotlight.xml configuration file.
 *   
 * @package SpotLight.core.configurator.collector
 * @version since 0.5.x.x
 * @author asmhack
 * @license GPL
 * @copyright Serhiy Zaporozhets'
 */
class InterceptorColl {
   /**
    * Required parameter
    *
    * @var String
    */
   private $class;
   
   private $file;
   /**
    * type of interceptor: "before" action or "after"
    * @var string
    */
   private $type;
   
   /**
    * URL pattern scope for this filter
    *
    * @var String
    */
   private $url;
/*
   public function __construct() {
      $this->type = 'before';
   }
*/
   public function setClass($class) {
      $this->class = $class;
   }
   
   /**
    * @return unknown
    */
   public function getType() {
      return $this->type;
   }
   
   public function isType($type) {
      return $this->type==$type;
   }
   
   /**
    * @param unknown_type $type
    */
   public function setType($type) {
      $this->type = $type;
   }
   
   public function getClass() {
      return $this->class;
   }
   
   /**
    * @return unknown
    */
   public function getUrl() {
      return $this->url;
   }
   
   public function checkUrl($actionName) {
      if (preg_match ( $this->url, $actionName ))
         return true;
      else
         return false;
   }
   
   /**
    * @param unknown_type $url
    */
   public function setUrl($url) {
      $this->url = $url;
   }
   
   public function setFile($file) {
      $this->file = $file;
   }
   
   public function getFile() {
      return $this->file;
   }
   
   public function __toString() {
      $txt = '&nbsp;&nbsp;&nbsp;&nbsp;Interceptor "<i>' . $this->type . '</i>" on <b>' . $this->class . '</b> for ' . $this->url . ';';
      return $txt;
   }

}
?>